package com.netease.pris.a;

import android.content.Context;
import android.net.Uri;
import android.provider.MediaStore.Audio.Media;
import android.provider.MediaStore.Video.Media;
import android.text.TextUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.Method;
import java.util.List;

public class f
{
  static final String a = "FileUtils";
  static Method b = null;

  public static Uri a(File paramFile)
  {
    if (paramFile != null);
    for (Uri localUri = Uri.fromFile(paramFile); ; localUri = null)
      return localUri;
  }

  public static File a(Uri paramUri)
  {
    String str;
    if (paramUri != null)
    {
      str = paramUri.getPath();
      if (str == null);
    }
    for (File localFile = new File(str); ; localFile = null)
      return localFile;
  }

  public static File a(File paramFile, String paramString)
  {
    return a(paramFile.getAbsolutePath(), paramString);
  }

  public static File a(String paramString1, String paramString2)
  {
    String str = "/";
    if (paramString1.endsWith("/"))
      str = "";
    return new File(paramString1 + str + paramString2);
  }

  public static String a(Context paramContext, long paramLong)
  {
    String str1 = null;
    if (b == null)
      a();
    try
    {
      Method localMethod = b;
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = paramContext;
      arrayOfObject[1] = Long.valueOf(paramLong);
      str2 = (String)localMethod.invoke(null, arrayOfObject);
      if (str2 == null)
        str2 = Long.toString(paramLong / 1024L) + "KB";
      return str2;
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        if (0 != 0)
          break;
        str2 = Long.toString(paramLong / 1024L) + "KB";
      }
    }
    finally
    {
      while (true)
      {
        if (0 == 0)
          str1 = Long.toString(paramLong / 1024L) + "KB";
        String str2 = str1;
        continue;
        str2 = null;
      }
    }
  }

  private static void a()
  {
    try
    {
      Class localClass = Class.forName("android.text.format.Formatter");
      Class[] arrayOfClass = new Class[2];
      arrayOfClass[0] = Context.class;
      arrayOfClass[1] = Long.TYPE;
      b = localClass.getMethod("formatFileSize", arrayOfClass);
      label32: return;
    }
    catch (Exception localException)
    {
      break label32;
    }
  }

  public static boolean a(File paramFile1, File paramFile2)
  {
    int i = 0;
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(paramFile2);
      FileOutputStream localFileOutputStream = new FileOutputStream(paramFile1);
      byte[] arrayOfByte = new byte[1024];
      while (true)
      {
        int j = localFileInputStream.read(arrayOfByte);
        if (j <= 0)
        {
          localFileOutputStream.close();
          localFileInputStream.close();
          i = 1;
          break;
        }
        localFileOutputStream.write(arrayOfByte, 0, j);
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return i;
  }

  public static boolean a(File paramFile, List paramList)
  {
    File[] arrayOfFile;
    if (paramFile.exists())
    {
      arrayOfFile = paramFile.listFiles();
      if ((arrayOfFile != null) && (arrayOfFile.length > 0));
    }
    else
    {
      return true;
    }
    int i = 0;
    label25: if (i < arrayOfFile.length)
    {
      if (!arrayOfFile[i].isDirectory())
        break label58;
      a(arrayOfFile[i], paramList);
    }
    while (true)
    {
      arrayOfFile[i] = null;
      i++;
      break label25;
      break;
      label58: if (paramList.contains(arrayOfFile[i].getPath()))
        continue;
      arrayOfFile[i].delete();
    }
  }

  public static boolean a(String paramString)
  {
    if ((paramString != null) && (!paramString.startsWith("http://")));
    for (int i = 1; ; i = 0)
      return i;
  }

  public static boolean a(String paramString, int paramInt)
  {
    if (TextUtils.isEmpty(paramString));
    for (int i = 0; ; i = 1)
      return i;
  }

  public static File b(File paramFile)
  {
    if (paramFile != null)
      if (!paramFile.isDirectory());
    while (true)
    {
      return paramFile;
      String str1 = paramFile.getName();
      String str2 = paramFile.getAbsolutePath();
      String str3 = str2.substring(0, str2.length() - str1.length());
      if (str3.endsWith("/"))
        str3 = str3.substring(0, -1 + str3.length());
      paramFile = new File(str3);
      continue;
      paramFile = null;
    }
  }

  public static String b(String paramString)
  {
    String str;
    if (paramString == null)
      str = null;
    while (true)
    {
      return str;
      int i = paramString.lastIndexOf(".");
      if (i >= 0)
      {
        str = paramString.substring(i);
        continue;
      }
      str = "";
    }
  }

  public static boolean c(File paramFile)
  {
    File[] arrayOfFile;
    if (paramFile.exists())
    {
      arrayOfFile = paramFile.listFiles();
      if ((arrayOfFile != null) && (arrayOfFile.length > 0));
    }
    for (boolean bool = true; ; bool = paramFile.delete())
    {
      return bool;
      int i = 0;
      if (i >= arrayOfFile.length)
        continue;
      if (arrayOfFile[i].isDirectory())
        c(arrayOfFile[i]);
      while (true)
      {
        arrayOfFile[i] = null;
        i++;
        break;
        arrayOfFile[i].delete();
      }
    }
  }

  public static boolean c(String paramString)
  {
    if ((paramString.startsWith(MediaStore.Audio.Media.INTERNAL_CONTENT_URI.toString())) || (paramString.startsWith(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI.toString())) || (paramString.startsWith(MediaStore.Video.Media.INTERNAL_CONTENT_URI.toString())) || (paramString.startsWith(MediaStore.Video.Media.EXTERNAL_CONTENT_URI.toString())));
    for (int i = 1; ; i = 0)
      return i;
  }

  public static int d(File paramFile)
  {
    int i = 0;
    if ((paramFile != null) && (paramFile.exists()))
    {
      String[] arrayOfString = paramFile.list();
      if (arrayOfString != null)
        i = arrayOfString.length;
    }
    return i;
  }

  public static long e(File paramFile)
  {
    long l = 0L;
    int i = 0;
    String[] arrayOfString;
    if ((paramFile != null) && (paramFile.exists()))
    {
      arrayOfString = paramFile.list();
      if (arrayOfString != null)
        break label36;
    }
    label36: for (int j = 0; j <= 0; j = arrayOfString.length)
      return l;
    label44: File localFile;
    if (i < j)
    {
      localFile = new File(paramFile, arrayOfString[i]);
      arrayOfString[i] = null;
      if (!localFile.isDirectory())
        break label91;
      l += e(localFile);
    }
    while (true)
    {
      i++;
      break label44;
      break;
      label91: l += localFile.length();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.a.f
 * JD-Core Version:    0.6.0
 */